翻訳と辞書
Words near each other
・ Coherent space
・ Coherent spectroscopy
・ Coherent states
・ Coherent states in mathematical physics
・ Coherent topology
・ Coherent turbulent structure
・ Coherent, Inc.
・ Coherentism
・ Coherer
・ Cohesin
・ Cohesin domain
・ Cohesion
・ Cohesion (album)
・ Cohesion (band)
・ Cohesion (chemistry)
Cohesion (computer science)
・ Cohesion (geology)
・ Cohesion (linguistics)
・ Cohesive zone model
・ Cohetzala
・ Cohiba
・ Cohiba (cigar brand)
・ Cohiba (cigarette)
・ Cohiniac
・ Cohiño
・ Cohler
・ Cohmad Securities
・ Cohn
・ Cohn & Wolfe
・ Cohn Bluff


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Cohesion (computer science) : ウィキペディア英語版
Cohesion (computer science)
In computer programming, cohesion refers to the ''degree to which the elements of a module belong together''. Thus, cohesion measures the strength of relationship between pieces of functionality within a given module. For example, in highly cohesive systems functionality is strongly related.
Cohesion is an ordinal type of measurement and is usually described as “high cohesion” or “low cohesion”. Modules with high cohesion tend to be preferable because high cohesion is associated with several desirable traits of software including robustness, reliability, reusability, and understandability whereas low cohesion is associated with undesirable traits such as being difficult to maintain, test, reuse, or even understand.
Cohesion is often contrasted with coupling, a different concept. High cohesion often correlates with loose coupling, and vice versa. The software metrics of coupling and cohesion were invented by Larry Constantine in the late 1960s as part of Structured Design, based on characteristics of “good” programming practices that reduced maintenance and modification costs. Structured Design, cohesion and coupling were published in the article and the book ; the latter two subsequently became standard terms in software engineering.
In object-oriented programming, if the methods that serve a class tend to be similar in many aspects, then the class is said to have high cohesion. In a highly cohesive system, code readability and reusability is increased, while complexity is kept manageable.
Cohesion is increased if:
*The functionalities embedded in a class, accessed through its methods, have much in common.
*Methods carry out a small number of related activities, by ''avoiding'' coarsely grained or unrelated sets of data.
Advantages of high cohesion (or “strong cohesion”) are:
*Reduced module complexity (they are simpler, having fewer operations).
*Increased system maintainability, because logical changes in the domain affect fewer modules, and because changes in one module require fewer changes in other modules.
*Increased module reusability, because application developers will find the component they need more easily among the cohesive set of operations provided by the module.
While in principle a module can have perfect cohesion by only consisting of a single, atomic element – having a single function, for example – in practice complex tasks are not expressible by a single, simple element. Thus a single-element module has an element that either is too complicated, in order to accomplish task, or is too narrow, and thus tightly coupled to other modules. Thus cohesion is balanced with both unit complexity and coupling.
== Types of cohesion ==
Cohesion is a qualitative measure, meaning that the source code to be measured is examined using a rubric to determine a classification. Cohesion types, from the worst to the best, are as follows:
;Coincidental cohesion (worst): Coincidental cohesion is when parts of a module are grouped arbitrarily; the only relationship between the parts is that they have been grouped together (e.g. a “Utilities” class).
;Logical cohesion: Logical cohesion is when parts of a module are grouped because they are logically categorized to do the same thing even though they are different by nature (e.g. grouping all mouse and keyboard input handling routines).
;Temporal cohesion: Temporal cohesion is when parts of a module are grouped by when they are processed - the parts are processed at a particular time in program execution (e.g. a function which is called after catching an exception which closes open files, creates an error log, and notifies the user).
;Procedural cohesion: Procedural cohesion is when parts of a module are grouped because they always follow a certain sequence of execution (e.g. a function which checks file permissions and then opens the file).
;Communicational/informational cohesion: Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g. a module which operates on the same record of information).
;Sequential cohesion: Sequential cohesion is when parts of a module are grouped because the output from one part is the input to another part like an assembly line (e.g. a function which reads data from a file and processes the data).
;Functional cohesion (best): Functional cohesion is when parts of a module are grouped because they all contribute to a single well-defined task of the module (e.g. Lexical analysis of an XML string).
Although cohesion is a ranking type of scale, the ranks do not indicate a steady progression of improved cohesion. Studies by various people including Larry Constantine, Edward Yourdon, and Steve McConnell 〔Code Complete 2nd Ed., p168-171〕 indicate that the first two types of cohesion are inferior; communicational and sequential cohesion are very good; and functional cohesion is superior.
While functional cohesion is considered the most desirable type of cohesion for a software module, it may not be achievable. There are cases where communicational cohesion is the highest level of cohesion that can be attained under the circumstances.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Cohesion (computer science)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.